package Buyer;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

public class IntermediaryMethodInterceptor implements MethodInterceptor {
    @Override
    public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
        before();
        Object feedback=methodProxy.invokeSuper(o,objects);
        after();
        return "看房记录：买家反馈："+feedback;
    }

    public void before(){
        System.out.println("前期准备");
        System.out.println("查看房源");
        System.out.println("和卖家沟通时间");
    }

    public void after(){
        System.out.println("后期跟踪");
        System.out.println("和买家沟通意见");
    }
}
